package org.nf.shopping.service.Impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.shopping.entity.Son;
import org.nf.shopping.mapper.SonMapper;
import org.nf.shopping.service.SonService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author czl
 * @Date 2024-12-12
 */
@Service
@RequiredArgsConstructor
public class SonServiceImpl implements SonService {

    private final SonMapper sonMapper;
    @Override
    public PageInfo<Son> listSon(Integer pageSize, Integer pageNum, String name) {
        List<Son> list = sonMapper.listSon(pageSize,pageNum,name);
        PageInfo<Son> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updateSon(Son son) {
        sonMapper.updateSon(son);
    }

    @Override
    public void deloneSon(Integer id) {
        sonMapper.deloneSon(id);
    }

    @Override
    public void addSon(Son son) {
        sonMapper.addSon(son);
    }

    @Override
    public List<Son> getSonList() {
        return sonMapper.getSonList();
    }
}
